﻿using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZY13.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class StateController : ControllerBase
    {
        public StateController(IStateBLL bll)
        {
            Bll = bll;
        }

        public IStateBLL Bll { get; }
        [HttpPost]
        public Task<int> AddState(StateModel state)
        {
            return Bll.AddState(state);
        }
        [HttpGet]
        public List<StateModel> GetStates()
        {
            return Bll.GetStates();
        }
    }
}
